< previous page page_200 next page >

Page 200
9f31265bb40b592b1929e18a47ab28e5.gif
   Me.Cls
   Me.Print strName
   Me.Print Left$(strName, 4)
   Me.Print Left$(strName, 7)
End Sub
The Left$() functions first parameter is the string you wish to retrieve the leftmost characters from. The 2nd parameter is how many of those characters you want to retrieve.
Right$( )
Right$() returns the rightmost number of characters specified in a string. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdRight_Click ()
   Dim strName As String
   strName = "Bill Gates"

   Me.Cls
   Me.Print strName
   Me.Print Right$(strName, 7)
   Me.Print Right$(strName, 10)
End Sub
The Right$() functions first parameter is the string you wish to retrieve the rightmost characters from. The 2nd parameter is how many of those characters you want to retrieve.
Mid$( )
Mid$() returns a substring of a specified number of characters within a string. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdMid_Click ()
   Dim strName As String
   strName = "Bill Gates"

   Me.Cls
   Me.Print strName
   Me.Print Mid$(strName, 1, 4)
   Me.Print Mid$(strName, 6, 2)
End Sub

 
< previous page page_200 next page >

If you like this book, buy it!